import requests


def amazon_login():
    base_host = "https://www.amazon.com"
    # 登录（会话cookie保持）
    session = requests.session()
    url = base_host + "/aaut/verify/ap?options=%7B%22clientData%22%3A%22%7B%5C%22emailAddress%5C%22%3A%5C%2217722515203%40163.com%5C%22%2C%5C%22sessionId%5C%22%3A%5C%22147-2900512-5367062%5C%22%2C%5C%22marketplaceId%5C%22%3A%5C%22ATVPDKIKX0DER%5C%22%2C%5C%22rid%5C%22%3A%5C%22G2KDJ08SNDV6X5XD45K1%5C%22%2C%5C%22ubid%5C%22%3A%5C%22134-6265531-9881750%5C%22%2C%5C%22pageType%5C%22%3A%5C%22AuthenticationPortal%5C%22%2C%5C%22appAction%5C%22%3A%5C%22SIGNIN_PWD_COLLECT%5C%22%7D%22%2C%22challengeType%22%3Anull%2C%22locale%22%3A%22zh-CN%22%2C%22externalId%22%3Anull%2C%22enableHeaderFooter%22%3Atrue%2C%22enableBypassMechanism%22%3Afalse%2C%22enableModalView%22%3Afalse%2C%22eventTrigger%22%3A%22PageLoad%22%2C%22aaExternalToken%22%3Anull%2C%22forceJsFlush%22%3Afalse%7D"
    # 请求体
    data = {"context": None,
            "options":"{\"clientData\":\"{\\\"emailAddress\\\":\\\"17722515203@163.com\\\",\\\"sessionId\\\":\\\"147-2900512-5367062\\\",\\\"marketplaceId\\\":\\\"ATVPDKIKX0DER\\\",\\\"rid\\\":\\\"G2KDJ08SNDV6X5XD45K1\\\",\\\"ubid\\\":\\\"134-6265531-9881750\\\",\\\"pageType\\\":\\\"AuthenticationPortal\\\",\\\"appAction\\\":\\\"SIGNIN_PWD_COLLECT\\\"}\",\"challengeType\":null,\"locale\":\"zh-CN\",\"externalId\":null,\"enableHeaderFooter\":true,\"enableBypassMechanism\":false,\"enableModalView\":false,\"eventTrigger\":\"PageLoad\",\"aaExternalToken\":null,\"forceJsFlush\":false}",
            "fwcimBlob": None}

    resp = session.post(url, data=data)
    print(resp.json())
